package org.giantlizard.cloud.user.token.base;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.Aspect;
import org.giantlizard.cloud.user.token.entity.User;
import org.springframework.stereotype.Component;

@Slf4j
@Aspect
@Component
public class CurrentLoginUser {

    private final ThreadLocal<User> currentUser = new ThreadLocal<>();

    public User getUser() {
        return currentUser.get();
    }

    public void setUser(User user) {
        currentUser.set(user);
    }

}
